/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    color: #2c3e50;
    font-size: 2em;
}

.main-content {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 20px;
}

.toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.toolbar-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toolbar-section label {
    font-weight: bold;
    color: #495057;
    font-size: 0.9em;
}

#searchInput {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    align-self: flex-end;
    grid-column: 1 / -1;
}

button {
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    white-space: nowrap;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.add-feature, .remove-feature {
    padding: 5px 10px;
    font-size: 14px;
    min-width: 30px;
    min-height: 30px;
}

.remove-feature {
    background-color: #e74c3c;
}

.remove-feature:hover {
    background-color: #c0392b;
}

#resetBtn {
    background-color: #95a5a6;
}

#resetBtn:hover {
    background-color: #7f8c8d;
}

#limitSelect {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    width: 100%;
}

.results-info {
    margin-bottom: 15px;
    font-weight: bold;
    color: #2c3e50;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #3498db;
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
}

tr:hover {
    background-color: #f9f9f9;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

tr:nth-child(even):hover {
    background-color: #f9f9f9;
}

/* 特殊单元格样式 */
.price-cell {
    font-weight: bold;
    color: #27ae60;
    font-size: 1.1em;
}

.features-cell {
    max-width: 400px;
}

.features-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    padding: 2px 0;
    border-bottom: 1px solid #eee;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li strong {
    color: #2c3e50;
}

.product-link {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.product-link:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination button {
    min-width: 80px;
}

#pageInfo {
    font-weight: bold;
    color: #2c3e50;
    white-space: nowrap;
}

/* 特性输入框组 */
.feature-input-group {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    align-items: center;
}

.feature-input-group .featureName,
.feature-input-group .featureValue {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.category-filter input,
.price-filter input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
}

.price-filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.price-filter label {
    grid-column: span 2;
    font-weight: bold;
    color: #495057;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .toolbar {
        grid-template-columns: 1fr;
    }
    
    .toolbar-actions {
        flex-direction: column;
        align-self: stretch;
    }
    
    #searchInput {
        min-width: 100%;
    }
    
    .main-content {
        padding: 15px;
    }
    
    th, td {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .features-cell {
        max-width: 200px;
    }
    
    .feature-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .price-filter {
        grid-template-columns: 1fr;
    }
    
    .price-filter label {
        grid-column: span 1;
    }
}